<?php
session_start();
$userid=null;
if (isset($_SESSION["userid"])==false || $_SESSION["userid"]==null) {
	header("Location: index.php");
	exit;
} else {
	$userid = $_SESSION["userid"];
}

			include("dbinit.php");
		$colEmail = $userid;
		$indexTour = $_POST["indexTour"];
		$tour_name = $_POST["tour_name"];
		$tour_startdate = date("o-m-d", strtotime($_POST["tour_startdate"]));
		$tour_enddate = date("o-m-d", strtotime($_POST["tour_enddate"]));		
		$tour_people = $_POST["tour_people"];
		$tour_description = $_POST["tour_description"];
		$tour_category = $_POST["tour_category"];
		
		$query = "UPDATE ucMaintour SET colTourname='$tour_name',colTourdescription='$tour_description',colDatestart='$tour_startdate',colDateend='$tour_enddate', colPeopleCount='$tour_people' WHERE indexTour=$indexTour";
		$result = mysql_query($query, $link);
		$query = "UPDATE ucTourcourses SET colDatestart='$tour_startdate',colDateend='$tour_enddate', colCategory='$tour_category' WHERE indexTour=$indexTour";
		$result = mysql_query($query, $link);

		if ($result) {
			echo "true";
		} else {
			echo "false";
		}		
		mysql_close($link);
?>